package org.gd.hellojavacore.patterns.singleton;

/**
 с отложенной инициализацией
 */
@SuppressWarnings("unused")
public class PostInitSingleton implements Singleton {

    private static volatile PostInitSingleton instance;

    private PostInitSingleton() {}

    public static PostInitSingleton getInstance() {
        if (instance == null) {
            synchronized (PostInitSingleton.class) {
                if (instance == null) {
                    instance = new PostInitSingleton();
                }
            }
        }
        return instance;
    }
}